import request from '@/utils/request'

// 查询组件列表
export function listNetwork(params) {
  return request({
    url: '/iot/network/list',
    method: 'get',
    params: params
  })
}
// 无分页查询组件列表
export function queryNetwork(params) {
  return request({
    url: '/iot/network/query',
    method: 'get',
    params: params
  })
}

// 新增组件
export function addNetwork(data) {
  return request({
    url: '/iot/network',
    method: 'post',
    data: data
  })
}

// 查询组件详细
export function getNetwork(id) {
  return request({
    url: '/iot/network/' + id,
    method: 'get'
  })
}

// 修改组件
export function updateNetwork(data) {
  return request({
    url: '/iot/network',
    method: 'put',
    data: data
  })
}

// 删除组件
export function delNetwork(id) {
  return request({
    url: '/iot/network/' + id,
    method: 'delete'
  })
}


// 导出组件
export function exportNetwork(query) {
  return request({
    url: '/iot/network/export',
    method: 'get',
    params: query
  })
}

//启动组件
export function startupNetwork(id) {
  return request({
    url: '/iot/network/startup/' + id,
    method: 'post',
  })
}

//停止组件
export function shutdownNetwork(id) {
  return request({
    url: '/iot/network/shutdown/' + id,
    method: 'delete',
  })
}

// 获取支持的网络组件类型
export function getNetworkType() {
  return request({
    url: '/iot/network/supports',
    method: 'get'
  })
}
